package org.aman.generator;

import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.api.VerboseProgressCallback;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.internal.DefaultShellCallback;

import java.io.File;
import java.io.InputStream;
import java.util.*;

/**
 * @author DaiJG
 * @title GeneratorMain功能描述
 * @Date created at 2019/8/16 9:17
 * @Description
 * @since 1.0.0
 */
public class GeneratorMain {
    public static void main(String[] args) throws Exception {
        List<String> warnings = new ArrayList<String>();
        boolean overwrite = true;
        ConfigurationParser cp = new ConfigurationParser(warnings);
        
        File configFile = new File("E:/iwksp/amancode/zstart/zstart-component/mybatis-generator/src/main/java/org/aman/generator/generator.xml");
        Configuration config = cp.parseConfiguration(configFile);
        
        DefaultShellCallback callback = new DefaultShellCallback(overwrite);
        MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
        myBatisGenerator.generate(new VerboseProgressCallback());
    }
}
